Applications
/* Name : main.c
* Purpose : Source code for Buzzer Interfacing with ARM LPC1248.
* Author : Gemicates
* Date : 2018-08-01
* Website : www.gemicates.org
* Revision : None
*/
#include<lpc21xx.h> // header file for LPC21XX series
void delay(int time) // delay function declaration
{ // This function produces a delay in msec
int i,j;
for(i=0;i<time;i++)
{
for(j=0;j<i;j++);
}
}
int main() // main function
{
PINSEL0=0X00000000; // select PORT0 as GPIO mode
IO0DIR=0XFFFFFFFF; // make PORT0 pin as Output mode
while(1) // Repeat(loop) forever
{
IO0SET=0XFFFFFFFF; // Set the PORT0 pins
delay(100); // hault for sometime
IO0CLR=0XFFFFFFFF; // clear the PORT0 pins
}
return 0; // return back to main function
}